﻿using System;
using DeepMixWorkflow;
using Microsoft.Phone.BackgroundAudio;

namespace DeepmixRadioClient.Workflow
{
    internal static class PlayerWorkflow
    {
        public static BackgroundAudioPlayer Player
        {
            get { return BackgroundAudioPlayer.Instance; }
        }

        public static AudioTrack PlayerTrack
        {
            get
            {
                try
                {
                    return Player.Track;
                }
                catch (InvalidOperationException)
                {
                    return null;
                }
            }
        }

        public static DeepMixMode Mode
        {
            get
            {
                string uri;
                return PlayerTrack.Tag.GetDeepMixMode(out uri);
            }
        }
    }
}